package com.yunji.cabinet.context.convert;

import com.yunji.cabinet.domain.UpgradeTaskDO;
import com.yunji.cabinet.vo.UpgradeTaskVO;
import com.yunji.common.utils.bean.BeanUtils;

import java.util.ArrayList;
import java.util.List;

public class UpgradeTaskConvert {
    public static List<UpgradeTaskVO> domainTOVOList(List<UpgradeTaskDO> list){
        List<UpgradeTaskVO> voList = new ArrayList<>();
        list.forEach(item->{
            UpgradeTaskVO vo = domainTOVO(item);
            voList.add(vo);
        });
        return voList;
    }

    public static UpgradeTaskVO domainTOVO(UpgradeTaskDO domain){
        UpgradeTaskVO vo = new UpgradeTaskVO();
        BeanUtils.clone(domain,vo);
        return vo;
    }
}
